/**
 * Copyright (c) 2013-2022, Alibaba Group Holding Limited;
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * </p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.aliyun.polardbx.cdc.qatest.flashback;

/**
 * created by ziyang.lb
 **/
public class FlashBackConstants {

    public static final String CREATE_SQL = "CREATE TABLE `%s`\n"
        + "(`id` bigint(20) NOT NULL AUTO_INCREMENT,\n"
        + "`c_bit_1` bit(1) DEFAULT NULL,\n"
        + "`c_bit_8` bit(8) DEFAULT NULL,\n"
        + "`c_bit_16` bit(16) DEFAULT NULL,\n"
        + "`c_bit_32` bit(32) DEFAULT NULL,\n"
        + "`c_bit_64` bit(64) DEFAULT NULL,\n"
        + "`c_tinyint_1` tinyint(1) DEFAULT NULL,\n"
        + "`c_tinyint_4` tinyint(4) DEFAULT NULL,\n"
        + "`c_tinyint_8` tinyint(8) DEFAULT NULL,\n"
        + "`c_tinyint_8_un` tinyint(8) unsigned DEFAULT NULL,\n"
        + "`c_smallint_1` smallint(1) DEFAULT NULL,\n"
        + "`c_smallint_16` smallint(16) DEFAULT NULL,\n"
        + "`c_smallint_16_un` smallint(16) unsigned DEFAULT NULL,\n"
        + "`c_mediumint_1` mediumint(1) DEFAULT NULL,\n"
        + "`c_mediumint_24` mediumint(24) DEFAULT NULL,\n"
        + "`c_mediumint_24_un` mediumint(24) unsigned DEFAULT NULL,\n"
        + "`c_int_1` int(1) DEFAULT NULL,\n"
        + "`c_int_32` int(32) DEFAULT NULL,\n"
        + "`c_int_32_un` int(32) unsigned DEFAULT NULL,\n"
        + "`c_bigint_1` bigint(1) DEFAULT NULL,\n"
        + "`c_bigint_64` bigint(64) DEFAULT NULL,\n"
        + "`c_bigint_64_un` bigint(64) unsigned DEFAULT NULL,\n"
        + "`c_decimal` decimal DEFAULT NULL,\n"
        + "`c_decimal_pr` decimal(10,3) DEFAULT NULL,\n"
        + "`c_float` float DEFAULT NULL,\n"
        + "`c_float_pr` float(10,3) DEFAULT NULL,\n"
        + "`c_float_un` float(10,3) unsigned DEFAULT NULL,\n"
        + "`c_double` double DEFAULT NULL,\n"
        + "`c_double_pr` double(10,3) DEFAULT NULL,\n"
        + "`c_double_un` double(10,3) unsigned DEFAULT NULL,\n"
        + "`c_date` date DEFAULT NULL COMMENT 'date',\n"
        + "`c_datetime` datetime DEFAULT NULL,\n"
        + "`c_timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,\n"
        + "`c_time` time DEFAULT NULL,\n"
        + "`c_year` year DEFAULT NULL,\n"
        + "`c_year_4` year(4) DEFAULT NULL,\n"
        + "`c_char` char(50) DEFAULT NULL,\n"
        + "`c_varchar` varchar(50) DEFAULT NULL,\n"
        + "`c_binary` binary(200) DEFAULT NULL,\n"
        + "`c_varbinary` varbinary(200) DEFAULT NULL,\n"
        + "`c_blob_tiny` tinyblob DEFAULT NULL,\n"
        + "`c_blob` blob DEFAULT NULL,\n"
        + "`c_blob_medium` mediumblob DEFAULT NULL,\n"
        + "`c_blob_long` longblob DEFAULT NULL,\n"
        + "`c_text_tiny` tinytext DEFAULT NULL,\n"
        + "`c_text` text DEFAULT NULL,\n"
        + "`c_text_medium` mediumtext DEFAULT NULL,\n"
        + "`c_text_long` longtext DEFAULT NULL,\n"
        + "`c_enum` enum('a','b','c') DEFAULT NULL,\n"
        + "`c_set` set('a','b','c') DEFAULT NULL,\n"
        + "`c_testcase` varchar(10) DEFAULT NULL,\n"
        + "PRIMARY KEY (`id`) )ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='10000000' dbpartition by hash(`id`) tbpartition by hash(`id`) tbpartitions 3";

    public static final String INSERT_SQL_1 =
        "INSERT transfer_test.table_flashback1 ("
            + "id , \n"
            + "c_bit_1 , \n"
            + "c_bit_8 , \n"
            + "c_bit_16 , \n"
            + "c_bit_32 , \n"
            + "c_bit_64 , \n"
            + "c_tinyint_1 , \n"
            + "c_tinyint_4 , \n"
            + "c_tinyint_8 , \n"
            + "c_tinyint_8_un , \n"
            + "c_smallint_1 , \n"
            + "c_smallint_16 , \n"
            + "c_smallint_16_un , \n"
            + "c_mediumint_1 , \n"
            + "c_mediumint_24 , \n"
            + "c_mediumint_24_un , \n"
            + "c_int_1 , \n"
            + "c_int_32 , \n"
            + "c_int_32_un , \n"
            + "c_bigint_1 , \n"
            + "c_bigint_64 , \n"
            + "c_bigint_64_un , \n"
            + "c_decimal , \n"
            + "c_decimal_pr , \n"
            + "c_float , \n"
            + "c_float_pr , \n"
            + "c_float_un , \n"
            + "c_double , \n"
            + "c_double_pr , \n"
            + "c_double_un , \n"
            + "c_date , \n"
            + "c_datetime , \n"
            + "c_timestamp , \n"
            + "c_time , \n"
            + "c_year , \n"
            + "c_year_4 , \n"
            + "c_char , \n"
            + "c_varchar , \n"
            + "c_binary , \n"
            + "c_varbinary , \n"
            + "c_blob_tiny , \n"
            + "c_blob , \n"
            + "c_blob_medium , \n"
            + "c_blob_long , \n"
            + "c_text_tiny , \n"
            + "c_text , \n"
            + "c_text_medium , \n"
            + "c_text_long , \n"
            + "c_enum , \n"
            + "c_set , \n"
            + "c_testcase) VALUES( \n"
            + "900580,\n"
            + "b'1' , \n"
            + "b'11111111' , \n"
            + "b'1111111111111111' , \n"
            + "b'11111111111111111111111111111111' , \n"
            + "b'1111111111111111111111111111111111111111111111111111111111111111' , \n"
            + "'82' , \n"
            + "'-101' , \n"
            + "'-75' , \n"
            + "'253' , \n"
            + "'14497' , \n"
            + "'5070' , \n"
            + "'9427' , \n"
            + "'-5888259' , \n"
            + "'-1845105' , \n"
            + "'2350597' , \n"
            + "'-2147483648' , \n"
            + "'-2147483648' , \n"
            + "'3653062473' , \n"
            + "'-816854218224922624' , \n"
            + "'7292572323853307904' , \n"
            + "'2902765992697493504' , \n"
            + "'-1613793319' , \n"
            + "'1223077.292' , \n"
            + "'9.1096275E8' , \n"
            + "'-5839673.5' , \n"
            + "'2648.644' , \n"
            + "'4.334081673614155E9' , \n"
            + "'6973286.176' , \n"
            + "'7630560.182' , \n"
            + "'2019-02-15' , \n"
            + "'2019-02-15 14:54:41' , \n"
            + "'2019-02-15 14:54:41' , \n"
            + "'20:12:46' , \n"
            + "'2019' , \n"
            + "'2019', \n"
            + "'select \\n from t\\n where t.name = \"你好\"',\n"
            + "'int a = max(4,5)',\n"
            + "'select \\n from t\\n where name = \"你好\" \\nand age = max(4,5)',\n"
            + "'varchar a = \uD83D\uDE0D\uD83D\uDE0D',\n"
            + "'select \\n from t\\n where name = \"你好\"',\n"
            + "'varchar a = \uD83D\uDE0D\uD83D\uDE0D',\n"
            + "'select t.name,t.age,t.salary 13\\n from employee t\\n where t.region <> \"杭州\"\\n and\\n t.nickname = \\\uD83D\uDE0D\"(此处省略300字)\";',\n"
            + "'int a = max(4,5)',\n"
            + "'你好',\n"
            + "'select \\n from t\\n where name = \"你好\"',\n"
            + "'select t.name,t.age,t.salary 13\\n from employee t\\n where t.region <> \"杭州\"\\n and\\n t.nickname = \"(此处省略300字)\";',\n"
            + "'int a = max(4,5)', \n"
            + "'a', \n"
            + "'a', \n"
            + "'caseNo1')";

    public static final String INSERT_SQL_2 =
        "INSERT INTO `transfer_test`.`table_flashback1` (`id` , `c_bit_1` , `c_bit_8` , `c_bit_16` , `c_bit_32` , `c_bit_64` , `c_tinyint_1` , `c_tinyint_4` , `c_tinyint_8` , `c_tinyint_8_un` , `c_smallint_1` , `c_smallint_16` , `c_smallint_16_un` , `c_mediumint_1` , `c_mediumint_24` , `c_mediumint_24_un` , `c_int_1` , `c_int_32` , `c_int_32_un` , `c_bigint_1` , `c_bigint_64` , `c_bigint_64_un` , `c_decimal` , `c_decimal_pr` , `c_float` , `c_float_pr` , `c_float_un` , `c_double` , `c_double_pr` , `c_double_un` , `c_date` , `c_datetime` , `c_timestamp` , `c_time` , `c_year` , `c_year_4` , `c_char` , `c_varchar` , `c_binary` , `c_varbinary` , `c_blob_tiny` , `c_blob` , `c_blob_medium` , `c_blob_long` , `c_text_tiny` , `c_text` , `c_text_medium` , `c_text_long` , `c_enum` , `c_set` , `c_testcase`) VALUES ('900580' , 1 , 255 , 65535 , 4294967295 , -1 , '82' , '-101' , '-75' , '253' , '14497' , '5070' , '9427' , '-5888259' , '-1845105' , '2350597' , '-2147483648' , '-2147483648' , '3653062473' , '-816854218224922624' , '7292572323853307904' , '2902765992697493504' , '-1613793319' , '1223077.292' , '9.1096275E8' , '-5839673.5' , '2648.644' , '4.334081673614155E9' , '6973286.176' , '7630560.182' , '2019-02-15' , '2019-02-15 14:54:41' , '2019-02-15 14:54:41' , '20:12:46' , '2019' , '2019' , 'select \\n from t\\n where t.name = \"你好\"' , 'int a = max(4,5)' , 0x73656C656374200A2066726F6D20740A207768657265206E616D65203D2022E4BDA0E5A5BD22200A616E6420616765203D206D617828342C3529 , 0x766172636861722061203D20F09F988DF09F988D , 0x73656C656374200A2066726F6D20740A207768657265206E616D65203D2022E4BDA0E5A5BD22 , 0x766172636861722061203D20F09F988DF09F988D , 0x73656C65637420742E6E616D652C742E6167652C742E73616C6172792031330A2066726F6D20656D706C6F79656520740A20776865726520742E726567696F6E203C3E2022E69DADE5B79E220A20616E640A20742E6E69636B6E616D65203D20F09F988D2228E6ADA4E5A484E79C81E795A5333030E5AD9729223B , 0x696E742061203D206D617828342C3529 , '你好' , 'select \\n from t\\n where name = \"你好\"' , 'select t.name,t.age,t.salary 13\\n from employee t\\n where t.region <> \"杭州\"\\n and\\n t.nickname = \"(此处省略300字)\";' , 'int a = max(4,5)' , '1' , 1 , 'caseNo1');";
}
